#ifndef __TRAY_H__
#define __TRAY_H__

#define WM_TRAY_NOTIFY	(WM_USER+1000)
class tray
{
public:
	tray();
	tray(UINT uid, HMENU hMenu = NULL);
	~tray();

	void set_notify_win(HWND hWnd, UINT msg = WM_TRAY_NOTIFY);
	void set_menu(HMENU hMenu);
	void set_menu(UINT uid);
	bool set(HICON icon, const char* tip = NULL);
	bool set(UINT uid, const char* tip = NULL);
	bool remove();
	LRESULT notify(WPARAM wparam, LPARAM lparam);

	inline HMENU menu()
	{
		return _menu;
	}

protected:
	NOTIFYICONDATA	_tray;
	HMENU			_menu;
};

#endif